/*******************************************************************************************************
 *   Copyright (C) 2009 by Rahul
 *   rahulrs@gmx.com
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the
 *   Free Software Foundation, Inc.,
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *********************************************************************************************************/
#ifndef KUTTANSIMPL_H
#define KUTTANSIMPL_H
//
#include <QMainWindow>
#include "ui_kuttans.h"
//
class KuttansImpl : public QMainWindow, public Ui::Kuttans
{
Q_OBJECT
public:
	KuttansImpl( QWidget * parent = 0, Qt::WFlags f = 0 );
protected:
        void closeEvent(QCloseEvent *event);
private slots:
	void open();
	bool save();
	bool saveAs();
	void newFile();
        void documentWasModified();
        void filePrintPdf();
        void filePrint();
        void filePrintPreview();
        void printPreview(QPrinter *);
        void textSize(const QString &p);
        void textFamily(const QString &f);
	void unicodeToASCII(QString, QString);
        void about();
	void Revathi_u2a();
	void Indulekha_u2a();
	void Karthika_u2a();
	void customMap_u2a();
	void ASCIIToUnicode(QString, QString);
	void Revathi_a2u();
	void Indulekha_a2u();
	void Karthika_a2u();
	void customMap_a2u();
        void asciiToUnicodePDF();
private:
	void loadFile(const QString &fileName);
	void setCurrentFile(const QString &fileName);
	QString strippedName(const QString &fullFileName);
	QString directoryName(const QString &fullFileName);
	bool saveFile(const QString &fileName);
    	bool maybeSave();
	char conversionDone(QString, QString);
	bool checkDocStatus(QString);
        void writeSettings();
        void readSettings();

	QString curFile;
	QString inputFile, outputFile;	// ഫോണ്ട് മാപ്പ് , യൂണിക്കോഡ്, ആസ്ക്കി എന്നീ ഫയലുകള്‍
	std::string mapFileString, sourceFileString, outputFileString;  //മുകളില്‍ പറഞവ string രൂപത്തിലാക്കിയത്
	std::string command;				// പയ്യന് കൊടുക്കാനുള്ള ആജ്ഞയുടെ 'ക്യുടി' രൂപം
	const char* systemCommand;		// പയ്യന്‍സിന്  കൊടുക്കാനുള്ള ആജ്ഞയുടെ യഥാര്‍ത്ഥരൂപം
	QString getMapFileName();

        QToolBar *tb;
        void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
        //void fontChanged(const QFont &f);
};
#endif




